import axios from 'axios';
import { req } from './axiosFun';

/**
 * 问卷管理
 * Author wuzhengru
 * date 2021-03-21
 **/
//问卷管理-admin-问卷列表
export const paperLists = () =>
{ return axios
({method: 'get',
    url: '/api/v1/admin/ques/admin/paperList',
    headers: {
        Authorization : localStorage.getItem('JWT_TOKEN')
    },})
    .then(res=> res.data)};
//问卷管理-user-问卷列表
export const paperListsByUser = (params) =>
{ return axios
({method: 'get',
    url: '/api/v1/admin/ques/user/paperList?token='+params,
    headers: {
        Authorization : localStorage.getItem('JWT_TOKEN')
    },})
    .then(res=> res.data)};
//问卷管理-条件查询
export const fuzzyQuery = (params) => {return req("post", "/api/v1/admin/ques/fuzzyQuery", params)};
//问卷管理-问卷数据
export const getPaperDetail = (params) => {return req("post", "/api/v1/admin/ques/paperData", params)};
//问卷管理-新增问卷
export const addPaper = (params) => {return req("post", "/api/v1/admin/ques/paper", params)};
//问卷管理-删除问卷
export const deletePaper = (params) => {return req("post", "/api/v1/admin/ques/deletePaper",params)};
//问卷管理-清空回收站
export const deleteAll = () => {return axios.get("/api/v1/admin/ques/deleteAll").then(res => res.data)};
//问卷管理-还原问卷
export const resPapers = (params) => {return req("post","/api/v1/admin/ques/resPaper", params)};
//问卷管理-更改问卷
export const updatePaper = (params) => {return req("put", "/api/v1/admin/ques/paper", params)};
//问卷管理-批量更新状态
export const updatePaperStatus = (params) => {return req("put", "/api/v1/admin/ques/papers", params)};
//问卷管理-填写问卷
export const quesAnswer = (params) => {return req("post","/api/v1/admin/ques/quesAnswer", params)};

//问卷管理-获取基本指数数据
export const getData = (params) => {return req("post","/api/v1/data/getIndexData", params)};
//问卷管理-获取排行数据
export const getDataRank = (params) => {return req("post","/api/v1/data/getDataRank", params)};
//问卷管理-获取完整数据报告
export const getCompleteReport = () =>
{ return axios
({method: 'get',
    url: '/api/v1/data/getCompleteReport',
    headers: {
        Authorization : localStorage.getItem('JWT_TOKEN')
    },})
    .then(res=> res.data)};
